﻿/******************************************************   
创建者: 曹亚亮
创建时间: 2017-05-13
修改:
修改时间: 
功能: 配货作业实体
 ******************************************************/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using com.nm.Attributes;

namespace DistributeAPI.Model
{
    public class PickingOperationsModel
    {

        #region 生成配货单号 model

        /// <summary>
        /// 获取配货单号实体类
        /// </summary>
        /// 作者：曹亚亮
        /// 时间：2017-05-17
        public class GetTaskBillNoModel
        {
            [ParamDescription("配货单号")]
            public string TaskBillNo { get; set; }
        }

        #endregion

        #region 分配虚拟仓 model

        /// <summary>
        /// 判断通知单号下的数据是否分配的实体类
        /// </summary>
        /// 作者：曹亚亮
        /// 时间：2017-06-10
        public class NoticeNoStockIDModel
        {
            [ParamDescription("默认分配的仓库ID数量集")]
            public IEnumerable<StockIDListModel> StockIDList { get; set; }

            [ParamDescription("根据通知单号获取的单据数量集")]
            public IEnumerable<PMArrNoticeModel> List { get; set; }
        }

        /// <summary>
        /// 根据通知单号获取单据数量表实体
        /// </summary>
        /// 作者：曹亚亮
        /// 时间：2017-05-13
        public class PMArrNoticeModel
        {
            [ParamDescription("公司代码")]
            public string CompanyID { get; set; }

            [ParamDescription("数据源")]
            public string ExtrSource { get; set; }

            [ParamDescription("单据状态")]
            public string CNStateName { get; set; }

            [ParamDescription("通知单号")]
            public string SourceBillNo { get; set; }

            [ParamDescription("供应商ID")]
            public string VendCustID { get; set; }

            [ParamDescription("供应商名称")]
            public string VendCustName { get; set; }

            [ParamDescription("仓库内码")]
            public string StockID { get; set; }

            [ParamDescription("仓库名称")]
            public string StockName { get; set; }

            [ParamDescription("货号")]
            public string MaterialID { get; set; }

            [ParamDescription("尺码ID")]
            public string SizeID { get; set; }

            [ParamDescription("尺码名称")]
            public string SizeName { get; set; }

            [ParamDescription("单据数量")]
            public decimal? TotalQty { get; set; }

            [ParamDescription("ERP订单号")]
            public string BillNo { get; set; }

            [ParamDescription("尺码排序")]
            public string SizeCodeSort { get; set; }

        }

        /// <summary>
        /// 获取默认分配仓库的ID实体类
        /// </summary>
        /// 作者：曹亚亮
        /// 时间：2017-06-12
        public class StockIDListModel
        {
            [ParamDescription("分配仓库内码")]
            public string StockID { get; set; }
        }

        /// <summary>
        /// 获取分配库存的结果实体类
        /// </summary>
        /// 作者：曹亚亮
        /// 时间：2017-05-16
        public class GetDCVirtualStockModel
        {
            [ParamDescription("公司代码")]
            public string CompanyID { get; set; }

            [ParamDescription("单号")]
            public string SourceBillNo { get; set; }

            [ParamDescription("仓库内码")]
            public string StockID { get; set; }

            [ParamDescription("仓库名称")]
            public string StockName { get; set; }

            [ParamDescription("货号ID")]
            public string MaterialID { get; set; }

            [ParamDescription("尺码ID")]
            public string SizeID { get; set; }

            [ParamDescription("尺码名称")]
            public string SizeName { get; set; }

            [ParamDescription("分配数")]
            public int TotalQty { get; set; }

        }

        /// <summary>
        /// 获取保存分配虚拟库存时生成的ERP订单号
        /// </summary>
        /// 作者：曹亚亮
        /// 时间：2017-06-13
        public class GetDCVirtualStockOrderModel
        {
            [ParamDescription("保存状态：0:生成调拨申请单(未生效)成功 1:无有效数据，无法生成ERP单据 -1:生成ERP单据失败")]
            public int RetVal { get; set; }

            [ParamDescription("状态描述")]
            public string Message { get; set; }

            [ParamDescription("获取分配库存的结果实体类")]
            public IEnumerable<EepBillNoModel> List { get; set; }
        }

        /// <summary>
        /// 保存分配结果实体类列表
        /// </summary>
        /// 作者：曹亚亮
        /// 时间：2017-05-15
        public class DCVirtualStockModelList
        {
            [ParamDescription("操作员ID")]
            public string UserID { get; set; }

            [ParamDescription("手工单号")]
            public string MaBillNo { get; set; }

            [ParamDescription("保存分配结果实体类")]
            public IList<InsertDCVirtualStockModel> List { get; set; }
        }

        /// <summary>
        /// 获取加上分配状态的分配库存结果实体类
        /// </summary>
        /// 作者：曹亚亮
        /// 时间：2017-06-12
        public class IsAllotDCVirtualStockModel
        {
            [ParamDescription("分配状态：（true：以分配，false：未分配")]
            public bool IsAllot { get; set; }

            [ParamDescription("获取分配库存的结果实体类")]
            public IEnumerable<GetDCVirtualStockModel> List { get; set; }
        }

        /// <summary>
        /// 保存分配结果实体类
        /// </summary>
        /// 作者：曹亚亮
        /// 时间：2017-05-15
        public class InsertDCVirtualStockModel
        {
            [ParamDescription("公司代码")]
            public string CompanyID { get; set; }

            [ParamDescription("单号")]
            public string SourceBillNo { get; set; }

            [ParamDescription("仓库内码")]
            public string StockID { get; set; }

            [ParamDescription("货号ID")]
            public string MaterialID { get; set; }

            [ParamDescription("尺码ID")]
            public string SizeID { get; set; }

            [ParamDescription("分配数")]
            public decimal? TotalQty { get; set; }

            [ParamDescription("数据源")]
            public string ExtrSource { get; set; }

        }

        #endregion

        #region 选货号 model

        /// <summary>
        /// 库存分配比例设置实体类
        /// </summary>
        /// 作者：曹亚亮
        /// 时间：2017-05-17
        public class SetDistributionModel
        {
            [ParamDescription("公司代码")]
            public string CompanyID { get; set; }

            [ParamDescription("仓库内码")]
            public string StockID { get; set; }

            [ParamDescription("仓库名称")]
            public string StockName { get; set; }

            [ParamDescription("货号ID")]
            public string MaterialID { get; set; }

            [ParamDescription("货号简称")]
            public string MaterialShortName { get; set; }

            [ParamDescription("尺码ID")]
            public string SizeID { get; set; }

            [ParamDescription("尺码名称")]
            public string SizeName { get; set; }

            [ParamDescription("库存数量")]
            public int TotalQty { get; set; }

            [ParamDescription("分配百分比")]
            public double Percentage { get; set; }

            [ParamDescription("分配数量")]
            public int AllottedNum { get; set; }

            [ParamDescription("留库数量")]
            public int ReserveNum { get; set; }

            [ParamDescription("尺码排序")]
            public string SizeCodeSort { get; set; }

            [ParamDescription("数据源")]
            public string ExtrSource { get; set; }
        }

        /// <summary>
        /// 获取可用库存的分配库存数量实体类
        /// </summary>
        /// 作者：曹亚亮
        /// 时间：2017-05-19
        public class GetAvailableNoModel
        {
            [ParamDescription("仓库内码")]
            public string StockID { get; set; }

            [ParamDescription("仓库名称")]
            public string StockName { get; set; }

            [ParamDescription("货号ID")]
            public string MaterialID { get; set; }

            [ParamDescription("货号简称")]
            public string MaterialShortName { get; set; }

            [ParamDescription("尺码名称")]
            public string SizeName { get; set; }

            [ParamDescription("库存数量")]
            public int CanQty { get; set; }
        }

        #endregion

        #region 店铺配货需求 model

        /// <summary>
        /// 获取店铺配货需求量实体类
        /// </summary>
        /// 作者：曹亚亮
        /// 时间：2017-05-19
        public class GetShopDistributionModel
        {
            [ParamDescription("公司代码")]
            public string CompanyID { get; set; }

            [ParamDescription("店铺内码")]
            public string ShopID { get; set; }

            [ParamDescription("店铺编号")]
            public string ShopCode { get; set; }

            [ParamDescription("店铺名称")]
            public string ShopName { get; set; }

            [ParamDescription("仓库内码")]
            public string StockID { get; set; }

            [ParamDescription("货号ID")]
            public string MaterialID { get; set; }

            [ParamDescription("尺码内码")]
            public string SizeID { get; set; }

            [ParamDescription("尺码名称")]
            public string SizeName { get; set; }

            [ParamDescription("配货需求量")]
            public int Qty { get; set; }

            private bool _selected = false;
            [ParamDescription("是否选中")]
            public bool Selected { get { return _selected; } set { _selected = value; } }

            [ParamDescription("标识")]
            public string OrderFlag { get; set; }

            [ParamDescription("省名称")]
            public string ProvinceName { get; set; }

            [ParamDescription("市名称")]
            public string CityName { get; set; }

            [ParamDescription("是否配货")]
            public string MoveFlag { get; set; }

            private bool _isFilter = false;
            [ParamDescription("过滤")]
            public bool isFilter { get { return _isFilter; } set { _isFilter = value; } }
        }

        #endregion

        #region 计算店铺排序 model

        /// <summary>
        /// 计算店铺排序参数实体类
        /// </summary>
        /// 作者：曹亚亮
        /// 时间：2017-06-07
        public class SetShopSortModel
        {
            [ParamDescription("任务单号")]
            public string TaskBillNo { get; set; }

            [ParamDescription("配货方式 1 可用库存 2 成品外发到货通知单")]
            public string TaskType { get; set; }

            [ParamDescription("公司代码")]
            public string CompanyID { get; set; }

            [ParamDescription("配货仓库内码")]
            public string OutStockID { get; set; }

            [ParamDescription("库存分配比例设置实体类")]
            public List<SetDistributionModel> StockList { get; set; }

            [ParamDescription("获取店铺配货需求量实体类")]
            public List<GetShopDistributionModel> ShopList { get; set; }
        }

        /// <summary>
        /// 获取累计更新率实体类
        /// </summary>
        /// 作者：曹亚亮
        /// 时间：2017-06-07
        public class GetUpdateRateModel
        {
            [ParamDescription("任务单号")]
            public string TaskBillNo { get; set; }

            [ParamDescription("货号ID")]
            public string MaterialID { get; set; }

            [ParamDescription("更新率")]
            public decimal UpdateRate { get; set; }

        }

        /// <summary>
        /// 获取店铺排序数实体类
        /// </summary>
        /// 作者：曹亚亮
        /// 时间：2017-06-07
        public class GetShopSortNumModel
        {
            [ParamDescription("任务单号")]
            public string TaskBillNo { get; set; }

            [ParamDescription("店铺内码")]
            public string ShopID { get; set; }

            [ParamDescription("货号ID")]
            public string MaterialID { get; set; }

            [ParamDescription("店铺排序数")]
            public int RowNum { get; set; }
        }

        #endregion

        #region 抢货作业 model

        /// <summary>
        /// 获取操作员编码ID和名称实体类
        /// </summary>
        /// 作者：曹亚亮
        /// 时间：2017-06-10
        public class GetOperatorModel
        {
            [ParamDescription("操作员ID")]
            public string UserID { get; set; }

            [ParamDescription("操作员编码")]
            public string UserCode { get; set; }

            [ParamDescription("操作员名称")]
            public string UserName { get; set; }
        }

        /// <summary>
        /// 获取抢货店铺需求实体类
        /// </summary>
        /// 作者：曹亚亮
        /// 时间：2017-06-10
        public class GetShopReqDetailModel
        {
            //[ParamDescription("公司代码")]
            //public string CompanyID { get; set; }

            [ParamDescription("店铺内码")]
            public string ShopID { get; set; }

            [ParamDescription("店铺名称")]
            public string ShopName { get; set; }

            //[ParamDescription("任务单号")]
            //public string TaskBillNo { get; set; }

            //[ParamDescription("配货仓库ID")]
            //public string OutStockID { get; set; }

            //[ParamDescription("配货仓库名称")]
            //public string StockName { get; set; }

            [ParamDescription("货号ID")]
            public string MaterialID { get; set; }

            //[ParamDescription("尺码内码")]
            //public string SizeID { get; set; }

            [ParamDescription("尺码名称")]
            public string SizeName { get; set; }

            [ParamDescription("配货需求量")]
            public int Qty { get; set; }

            [ParamDescription("配货结果")]
            public long? ActualQty { get; set; }

            [ParamDescription("是否以生成ERP单据")]
            public int FinishFlag { get; set; }

            [ParamDescription("是否是核心尺码")]
            public int SizeCoreFlag { get; set; }
        }

        /// <summary>
        /// 根据任务单号生成ERP到店铺的单据API 请求参数实体类
        /// </summary>
        /// 作者：曹亚亮
        /// 时间：2017-07-26
        public class SetErpShopOrderModel
        {
            [ParamDescription("任务单号")]
            public string TaskBillNo { get; set; }

            [ParamDescription("单据状态")]
            public string Billstatus { get; set; }

            [ParamDescription("操作员ID")]
            public string UserID { get; set; }

            [ParamDescription("配货方式:1可用库存 2成品外发到货通知单")]
            public string TaskType { get; set; }

            [ParamDescription("手工单号")]
            public string MaBillNo { get; set; }

            [ParamDescription("传入的店铺内码和货号对应实体类")]
            public List<SetShopIDMaterialID> List { get; set; }
        }

        /// <summary>
        /// 传入的店铺内码和货号对应实体类
        /// </summary>
        /// 作者：曹亚亮
        /// 时间：2017-07-26
        public class SetShopIDMaterialID
        {
            [ParamDescription("店铺内码")]
            public string ShopID { get; set; }

            [ParamDescription("货号ID")]
            public string MaterialID { get; set; }
        }

        /// <summary>
        /// 获取到店铺的ERP订单信息实体类
        /// </summary>
        /// 作者：曹亚亮
        /// 时间：2017-06-14
        public class GetErpShopOrderModel
        {
            [ParamDescription("保存状态：0:生成调拨申请单(未生效)成功 1:无有效数据，无法生成ERP单据 -1:生成ERP单据失败 4:生成调拨申请单(生效)成功 -2:以下货号可用库存不足，无法生成生效的调拨申请单")]
            public int RetVal { get; set; }

            [ParamDescription("状态描述")]
            public string Message { get; set; }

            [ParamDescription("获取分配库存的结果实体类")]
            public IEnumerable<EepBillNoModel> List { get; set; }

            [ParamDescription("错误代码为-2时返回的数据集")]
            public IEnumerable<ErpErrDataModel> Data { get; set; }
        }

        /// <summary>
        /// 生成ERP到店铺订单错误代码为-2时返回的数据集
        /// </summary>
        /// 作者：曹亚亮
        /// 时间：2017-06-14
        public class ErpErrDataModel
        {
            [ParamDescription("仓库")]
            public string StockName { get; set; }

            [ParamDescription("货号")]
            public string MaterialID { get; set; }

            [ParamDescription("尺码")]
            public string SizeName { get; set; }

            [ParamDescription("需求数量")]
            public int? Qty { get; set; }

            [ParamDescription("可用库存")]
            public int? CanQty { get; set; }

            [ParamDescription("差异数量")]
            public int? DiffQty { get; set; }
        }

        #endregion

        /// <summary>
        /// ERP订单号实体类
        /// </summary>
        /// 作者：曹亚亮
        /// 时间：2017-06-13
        public class EepBillNoModel
        {
            [ParamDescription("ERP订单号")]
            public string BillNo { get; set; }
        }

    }
}
